#include<stdio.h>
int k,i,date,n;
struct Day
{
    int year;
    int month;
    int day;
    int week;
} t;
void input(struct Day t)
{
   printf("请输入你所想的日期");
   scanf("%d,%d,%d",&t.year,&t.month,&t.day);
}
int whatDay(struct Day t, int &i)
{
    int Month[12]={0,31,28,31,30,31,30,31,31,30,31,30};
    for(i=0;i<t.month;i++) 
    {
    	date+=Month[i];
	}
    date+=t.day;
    return date;
}
int findDay(struct Day t,int &n)
{
    printf("如果你现在想得到的日期在上一步已经得到的日期前，请按1,否则请按2.");
    scanf("%d",&k);
    //whatDay(t,i);
	switch (k)
    {
    case 1:
        date-=n;
        break;
    case 2:
        date+=n;
        break;
    default:
        break;
    }
    return date;

}
int main()
{
    struct Day t;
    input(t);
    whatDay(t,i);
    if (date%7==0)
    {
      printf("这天是星期日");
    }else{
        t.week=date%7;
        printf("这天是星期%d",t.week);
    }
    printf("你也可以查询这天前n天或后n天是星期几,请输入n");
    scanf("%d",&n);
    
    findDay(t,n);
    if (date%7==0)
    {
        printf("这天是星期日");
    }else{
        t.week=date%7;
        printf("这天是星期%d",t.week);
    }

return 0;
}
